﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LimpaGaragem.BLL.User
{
    public class Message
    {
        /// <summary>
        /// Return list of message from user
        /// </summary>
        /// <returns></returns>
        public List<LimpaGaragem.Model.User.Message> GetListOfMessageFromUser(int IDUser)
        {
            try
            {
                return new LimpaGaragem.DAO.User.Message().GetListOfMessageFromUser(IDUser);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Return list of message to user
        /// </summary>
        /// <returns></returns>
        public List<LimpaGaragem.Model.User.Message> GetListOfMessageToUser(int IDUser)
        {
            try
            {
                return new LimpaGaragem.DAO.User.Message().GetListOfMessageToUser(IDUser);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Insert new favorite
        /// </summary>
        /// <returns>ID FAVORITE</returns>
        public int InsertMessage(int? IDMessageParent,
                                 int IDUserFrom,
                                 int IDUserTo,
                                 string Title,
                                 string Content)
        {
            try
            {
                return new LimpaGaragem.DAO.User.Message().InsertMessage(IDMessageParent,
                                                                         IDUserFrom,
                                                                         IDUserTo,
                                                                         Title,
                                                                         Content);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Delete favorite
        /// </summary>
        public void DeleteMessage(int IDMessage)
        {
            try
            {
                new LimpaGaragem.DAO.User.Message().DeleteMessage(IDMessage);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
